﻿using System;
using System.ServiceModel;
using Informant.Services.CommonFaults;
using Informant.Services.Models.SmsMessaging;

namespace Informant.Services.SmsMessaging
{
	[ServiceContract(Namespace = "http://Informant.Services.SmsMessaging/2010/04", SessionMode = SessionMode.Required, CallbackContract = typeof(ISmsServiceCallback))]
	public interface ISmsService
	{
		/// <summary>
		/// Logs the user on the SMS service.
		/// </summary>
		/// <param name="username">The username.</param>
		/// <param name="password">The password.</param>
		[OperationContract(Name = "LogOn")]
		[FaultContract(typeof(AuthorizationFault))]
		void LogOnSmsService(String username, String password);
		/// <summary>
		/// Logs the user off the SMS service.
		/// </summary>
		[OperationContract(Name = "LogOff", IsInitiating = false, IsTerminating = true)]
		[FaultContract(typeof(AuthorizationFault))]
		void LogOffSmsService();
		/// <summary>
		/// Deletes the SMS.
		/// </summary>
		/// <param name="smsId">The SMS id.</param>
		[OperationContract(IsInitiating = false)]
		[FaultContract(typeof(AuthorizationFault))]
		void DeleteSms(String smsId);
		/// <summary>
		/// Marks the read SMS.
		/// </summary>
		/// <param name="smsId">The SMS id.</param>
		/// <param name="isRead">if set to <c>true</c> [is read].</param>
		[OperationContract(IsInitiating = false)]
		[FaultContract(typeof(AuthorizationFault))]
		void MarkReadSms(String smsId, Boolean isRead);
		/// <summary>
		/// Retrieves all SMS.
		/// </summary>
		[OperationContract(IsInitiating = false)]
		[FaultContract(typeof(AuthorizationFault))]
		void RetrieveAllSms();
		/// <summary>
		/// Sends the SMS.
		/// </summary>
		/// <param name="sms">The SMS.</param>
		[OperationContract(IsInitiating = false)]
		[FaultContract(typeof(AuthorizationFault))]
		[FaultContract(typeof(SendSmsFault))]
		void SendSms(SmsServiceModel sms);
	}
}
